import javax.swing.JComponent;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;

public class ThreeDButtonComponent extends JComponent
{
   public void paintComponent(Graphics g)
   {
      Graphics2D g2 = (Graphics2D) g;
      // your work here
      
      Color c=Color.PINK;
      Color c1=c.brighter();
      Color c2=c.darker();
      g2.setColor(c);
      g2.fillRect(50,50,100,100);
      g2.setColor(c1);
      g2.fillRect(48,48,102,2);
      g2.fillRect(48,50,2,100);
      g2.setColor(c2);
      g2.fillRect(48,150,102,2);
      g2.fillRect(150,48,2,104);
   }
}